package cn.green.core.components.setter.defImpl.delete;

import cn.green.core.components.setter.DeleteKey;
import com.alibaba.fastjson.JSONObject;
import cn.green.core.model.QField;

/**
 * @author wang.yishu
 * @version 1.0
 * @className DeleteFlag
 * @description 删除标识
 * @date 2024/11/20 16:55
 */
public class DeleteFlag implements DeleteKey {

    @Override
    public Object deletedFlag() {
        return 1;
    }

    @Override
    public Object normalFlag() {
        return 0;
    }

    @Override
    public void setDeleted(QField field, JSONObject record) {
        record.put(field.getFieldName(), 1);
    }

    @Override
    public void setNormal(QField field, JSONObject record) {
        record.put(field.getFieldName(), 0);
    }
}
